
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>登录页面</title>
    <link href="${pageContext.request.contextPath}/plugins/css/bootstrap.min.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/plugins/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/plugins/css/animate.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/plugins/css/style.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/plugins/css/login.css" rel="stylesheet">
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <script>
        if (window.top !== window.self) {
            window.top.location = window.location;
        }
    </script>

</head>

<body class="signin">
<div class="signinpanel">
    <div class="row">
        <div class="col-sm-5" style="color:black; margin-left: 200px">
            <form method="post">
                <h4 class="no-margins">登录：</h4>
                <p class="m-t-md">饭团后台管理系统</p>
                <input type="text" class="form-control uname" id="username" placeholder="用户名" />
                <input type="password" class="form-control pword m-b" id="password" placeholder="密码" />
                <button  class="btn btn-success btn-block" type="button" onclick="login()">登录</button>
            </form>
        </div>
    </div>
    <div class="signup-footer">
        <div class="pull-left">

        </div>
    </div>
</div>

<script src="${pageContext.request.contextPath}/plugins/js/jquery.min.js"></script>
<script src="${pageContext.request.contextPath}/plugins/js/bootstrap.min.js"></script>

<script>
  function login() {
      var uname = document.getElementById("username").value;
      var pwd = document.getElementById("password").value;
      $.get('${pageContext.request.contextPath}/user/backlogin',{"userName":uname,"userPsd":pwd},function (data) {
          if(data.status==0){
                  alert(data.data);
          }else{
                  window.location='${pageContext.request.contextPath}/admin';
              }
  })
  }
</script>
</body>

</html>
